import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { Exclude } from 'class-transformer';

@Entity('users')
export class User {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ length: 50 })
  name: string;

  @Column({ type: 'int' })
  age: number;

  @Column({ unique: true })
  email: string;

  @Column({ nullable: true })
  location: string;

  @Column({ type: 'simple-array', nullable: true })
  interests: string[];

  @Column({ nullable: true })
  bio: string;

  @Column()
  @Exclude() // 在响应中排除密码字段
  password: string;

  // 新增字段 - 基本信息
  @Column({ nullable: true })
  gender: string; // 性别: 'male', 'female', 'other'

  @Column({ nullable: true })
  height: number; // 身高(cm)

  @Column({ nullable: true })
  weight: number; // 体重(kg)

  @Column({ nullable: true })
  education: string; // 教育程度: 'high_school', 'college', 'bachelor', 'master', 'phd'

  @Column({ nullable: true })
  occupation: string; // 职业

  @Column({ nullable: true })
  income: string; // 收入范围: 'low', 'medium', 'high', 'very_high'

  // 新增字段 - 婚姻与家庭
  @Column({ nullable: true })
  maritalStatus: string; // 婚姻状态: 'single', 'divorced', 'widowed'

  @Column({ nullable: true })
  hasChildren: boolean; // 是否有孩子

  @Column({ nullable: true })
  wantsChildren: boolean; // 是否想要孩子

  // 新增字段 - 生活习惯
  @Column({ nullable: true })
  smoking: string; // 吸烟习惯: 'never', 'occasionally', 'regularly'

  @Column({ nullable: true })
  drinking: string; // 饮酒习惯: 'never', 'socially', 'regularly'

  @Column({ nullable: true })
  diet: string; // 饮食习惯: 'omnivore', 'vegetarian', 'vegan', 'other'

  @Column({ nullable: true })
  hasPets: boolean; // 是否养宠物

  @Column({ type: 'simple-array', nullable: true })
  pets: string[]; // 宠物类型: ['dog', 'cat', 'bird', ...]

  // 新增字段 - 兴趣与价值观
  @Column({ type: 'simple-array', nullable: true })
  hobbies: string[]; // 详细的兴趣爱好

  @Column({ type: 'simple-array', nullable: true })
  values: string[]; // 价值观: ['family', 'career', 'spirituality', ...]

  @Column({ nullable: true })
  religion: string; // 宗教信仰

  @Column({ nullable: true })
  politicalView: string; // 政治观点

  // 新增字段 - 交友偏好
  @Column({ nullable: true })
  relationshipGoal: string; // 交友目的: 'casual', 'serious', 'marriage'

  @Column({ type: 'simple-array', nullable: true })
  languages: string[]; // 会说的语言

  @CreateDateColumn()
  createdAt: Date;

  @UpdateDateColumn()
  updatedAt: Date;
}